/*
 *  photoBoothController.h
 *  UseYourHeadApp001
 *
 *  Created by Arne Boon on 5/26/11.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */

#ifndef PHOTOBOOTH_CONTROLLER
#define PHOTOBOOTH_CONTROLLER

#include "ofMain.h"

#define GRABBED_VID_WIDTH 440
#define GRABBED_VID_HEIGHT 480
#define GRABBED_VID_TOP 390
#define GRABBED_VID_BOTTOM 90
#define DRAW_TOP 100
#define DRAW_BOTTOM 30

class photoBoothController : public ofBaseApp{
	
	public:
	
		photoBoothController();
		~photoBoothController();

		void setup();
		void update();
		void draw();
	
		void mirrorVideo();
		void setHead();
		void setScale();
		void setMouthSpeeds();
		void moveMouth();
	
		void keyPressed  (int key);
	
	private:
		
		//--video
		unsigned char drawingPixels[GRABBED_VID_WIDTH * GRABBED_VID_HEIGHT * 4];
		unsigned char dataPixels[GRABBED_VID_WIDTH * GRABBED_VID_HEIGHT * 4];
		ofVideoGrabber videoIn;
		ofTexture top;
		ofTexture bottom;
		
		ofVideoGrabber vidGrabber;
		ofTexture mirrorTexture;
		unsigned char * videoMirror;
		int camWidth;
		int camHeight;
		
		int totalPixels;
		int totalPixelsTop;
		int offsetMouth;
		int headX;
		int headY;
		int headTopY;
		int headBottomY;
		ofImage snapShot;
		ofImage topImage;
		ofImage bottomImage;
		bool snapShotTaken;
		bool mouthOpen;
		bool animation;
		unsigned char * snapShotPixels;
		unsigned char * upperPixels;
		unsigned char * lowerPixels;
		float scale;

	
};

#endif